package com.platform.server.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.platform.server.dao.OrderDao;
import com.platform.server.service.OrderService;
import com.szrca.ima.utils.StringTools;

@Service
public class OrderServiceImpl implements OrderService {

	@Autowired
	private OrderDao orderDao;
	
	/**
	 * 订单列表
	 */
	@Override
	public List<Map<String, Object>> selectOrderList(String id,String startTime,String endTime,String status,String order_id,String serveraddres,String mobile,String type,String subtype) {
		Map<String,Object> map = new HashMap<>();
		if(!StringTools.isEmpty(id)){
			map.put("id", Integer.parseInt(id));
		}
		map.put("startTime", startTime);
		map.put("endTime", endTime);
		map.put("status", status);
		map.put("order_id", order_id);
		map.put("mobile", mobile);
		map.put("type", type);
		map.put("mobile", mobile);
		map.put("serveraddres", serveraddres);
		map.put("subtype", subtype);
		return orderDao.selectOrderList(map);
	}

	/**
	 * 删除订单
	 */
	@Override
	public int deleteOrder(String id) {
		return orderDao.deleteOrder(id);
	}

	/**
	 * 获取子类型
	 */
	@Override
	public List<Map<String,Object>> subType(String vaule) {
		return orderDao.subType(vaule);	
	}
	
}
